<?php  if ( ! defined('DLFMPATH')) exit('No direct script access allowed');

    /*** error reporting on ***/
    error_reporting(E_ALL);
    
    /*** include the devlism class ***/
    include DLFMPATH . '/core/' . 'Devlism.class.php';
    
    /*** include the registry class ***/
    include DLFMPATH . '/core/' . 'Registry.class.php';
    
    /*** include the router class ***/
    include DLFMPATH . '/core/' . 'DL_Router.class.php';
    
    /*** include the controller class ***/
    include DLFMPATH . '/core/' . 'DL_Model.class.php';
    
    /*** include the view class ***/
    include DLFMPATH . '/core/' . 'DL_View.class.php';
    
    /*** include the controller class ***/
    include DLFMPATH . '/core/' . 'DL_Controller.class.php';
    
    /*** include the flourish library ***/
    include DLFMPATH . '/libraries/' . 'flourish.php';
    
    /*** include the devlism helpers ***/
    include DLFMPATH . '/helpers/' . 'dl_helper.php';
    
    /*** include the config files ***/
    include BASEPATH . '/config/' . 'config.php';
    include BASEPATH . '/config/' . 'my_config.php';
    include BASEPATH . '/config/' . 'autoload.php';
    
    ///*** a new dl (devlism mvc) object ***/
    $uri_route = new DL_Router();
    //echo '<pre>';
    //print_r($uri_route->controller);
    //echo '</pre>';
    
    //===============================================
    // Start the controller
    //===============================================
    include_once BASEPATH . "/modules/{$uri_route->controller['module']}/controllers/{$uri_route->controller['folder']}{$uri_route->controller['class']}_controller.php";
    $class = mb_convert_case("{$uri_route->controller['class']}_controller", MB_CASE_TITLE, "UTF-8");
    
    if(class_exists($class)){
	$controller = new $class;
	$controller->set_controller($uri_route->controller,'controllers',$uri_route->vars);
	$controller->run_controller();
    }else{
	Devlism::error("Class $class dose not exits!");
    }
    
/* End of file devlism_init.php */
/* Location: ./core/devlism_init.php */